import request from '@/utils/request'

// 获取员工列表
export const employeeListService = (params) => request.get('/sys/user', { params })

// 员工信息excel导出
export const employeeExportService = () => request.get('/sys/user/export', { responseType: 'blob' })

// 下载导入员工模板
export const employeeImportTemplateService = () => request.get('/sys/user/import/template', { responseType: 'blob' })

// 员工信息excel导入, data 为 FormData 对象
export const employeeImportService = (data) => request.post('/sys/user/import', data, { headers: { 'Content-Type': 'multipart/form-data' }})

// 删除员工
export const employeeDeleteService = (id) => request.delete(`/sys/user/${id}`)

// 新增员工
export const employeeAddService = (data) => request.post('/sys/user', data)

// 获取员工详情
export const employeeDetailService = (id) => request.get(`/sys/user/${id}`)

// 修改员工
export const employeeUpdateService = (data) => request.put(`/sys/user/${data.id}`, data)

// 分配员工角色
export const employeeAssaignRoleService = (data) => request.put('/sys/user/assignRoles', data)

